package com.lu.parser;

import java.lang.annotation.Annotation;

import com.lu.annotation.MyAnnoation;
import com.lu.beannoated.Annoated;

/**
 * 注解解析器
 * 
 * @author lusm
 *
 */
public class MyAnnoationParser {
	public void parse() {
		Class<Annoated> clazz = Annoated.class;
		
		Annotation[] ans=clazz.getAnnotations();
		System.out.println("所有的注解开始");
		for (Annotation annotation : ans) {
			System.out.println(annotation);
		}
		System.out.println("所有的注解结束");
	
		MyAnnoation myAnnoation=clazz.getAnnotation(MyAnnoation.class);
		System.out.println("获取MyAnnoation");
		System.out.println(myAnnoation);
		System.out.println("获取MyAnnoation的详细信息");
		System.out.println("author---"+myAnnoation.author());
		System.out.println("description---"+myAnnoation.description());
		System.out.println("time---"+myAnnoation.time());
		
		
	}
}
